package com.venta.autopartes.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class BaseDAO {
	protected static Statement statement = null;
	protected static ResultSet resultSet = null;
	protected static Connection connection = null;
	protected static PreparedStatement preparedStatement = null;
	
	protected static void closeConnection() {
		try {
			if (resultSet != null) {
				resultSet.close();
				resultSet = null;
			}
			if (statement != null) {
				statement.close();
				statement = null;
			}
			if (preparedStatement != null) {
				preparedStatement.close();
				preparedStatement = null;
			}
			if (connection != null) {
				connection.close();
				connection = null;
			}
		} catch (SQLException sqlException) {
			System.out.println("(Class)UserDAO - (ErrorType)sqlException");
			sqlException.printStackTrace();

		}
	}
}
